/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80018
 Source Host           : localhost:3306
 Source Schema         : naio

 Target Server Type    : MySQL
 Target Server Version : 80018
 File Encoding         : 65001

 Date: 30/05/2020 09:19:21
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `group_id` int(11) DEFAULT '0',
  `status` int(1) unsigned DEFAULT '1',
  `email` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `avatar` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `mobile` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of admin
-- ----------------------------
BEGIN;
INSERT INTO `admin` VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, 1, 'xiaoxiao@qq.com', NULL, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for admin_role
-- ----------------------------
DROP TABLE IF EXISTS `admin_role`;
CREATE TABLE `admin_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `admin_id` int(11) DEFAULT NULL COMMENT '管理员表id',
  `role_id` int(11) DEFAULT NULL COMMENT '角色表id',
  `create_time` int(11) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  `delete_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='管理员和角色关系表';

-- ----------------------------
-- Records of admin_role
-- ----------------------------
BEGIN;
INSERT INTO `admin_role` VALUES (4, 1, 1, NULL, NULL, NULL);
INSERT INTO `admin_role` VALUES (5, 1, 2, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for permission
-- ----------------------------
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '菜单名称',
  `parent_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父级ID',
  `level` varchar(50) NOT NULL DEFAULT '' COMMENT '层级',
  `route` varchar(50) NOT NULL DEFAULT '' COMMENT '路由',
  `icon` varchar(50) NOT NULL DEFAULT '' COMMENT '菜单图标',
  `module` varchar(20) NOT NULL DEFAULT '' COMMENT '模块',
  `creator_id` int(11) NOT NULL DEFAULT '0' COMMENT '创建人ID',
  `method` varchar(15) NOT NULL DEFAULT 'get' COMMENT '路由请求方法',
  `permission_mark` varchar(50) NOT NULL COMMENT '权限标识',
  `component` varchar(255) NOT NULL DEFAULT '' COMMENT '组件名称',
  `redirect` varchar(255) NOT NULL DEFAULT '' COMMENT '跳转地址',
  `hide_children_in_menu` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1 显示 2隐藏',
  `keepalive` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1 缓存 2 不存在 ',
  `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1 菜单 2 按钮',
  `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序字段',
  `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  `deleted_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '删除状态，null 未删除 timestamp 已删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8 COMMENT='菜单表';

-- ----------------------------
-- Records of permission
-- ----------------------------
BEGIN;
INSERT INTO `permission` VALUES (1, '权限管理', 0, '', '/permissions', 'appstore', 'system', 1, 'get', 'permission@index', 'pageView', '', 2, 1, 1, 100, 1587461455, 1587622113, 0);
INSERT INTO `permission` VALUES (2, '用户管理', 1, '1', '/permissions/users', 'user', 'permissions', 1, 'get', 'user@index', 'users', '', 2, 1, 1, 10, 1587461597, 1587547118, 0);
INSERT INTO `permission` VALUES (3, '列表', 2, '1-2', '', '', 'permissions', 1, 'get', 'user@index', '', '', 1, 1, 2, 1, 1587461647, 1587548455, 0);
INSERT INTO `permission` VALUES (4, '创建', 2, '1-2', '', '', 'permissions', 1, 'get', 'user@create', '', '', 1, 1, 2, 1, 1587461696, 1587547118, 0);
INSERT INTO `permission` VALUES (5, '保存', 2, '1-2', '', '', 'permissions', 1, 'get', 'user@save', '', '', 1, 1, 2, 1, 1587461721, 1587547118, 0);
INSERT INTO `permission` VALUES (6, '查看', 2, '1-2', '', '', 'permissions', 1, 'get', 'user@edit', '', '', 1, 1, 2, 1, 1587461742, 1587547118, 0);
INSERT INTO `permission` VALUES (7, '更新', 2, '1-2', '', '', 'permissions', 1, 'get', 'user@update', '', '', 1, 1, 2, 1, 1587461762, 1587547118, 0);
INSERT INTO `permission` VALUES (8, '删除', 2, '1-2', '', '', 'permissions', 1, 'get', 'user@delete', '', '', 1, 1, 2, 1, 1587461841, 1587547118, 0);
INSERT INTO `permission` VALUES (9, '禁用', 2, '1-2', '', '', 'permissions', 1, 'get', 'user@switchStatus', '', '', 1, 1, 2, 1, 1587461876, 1587547118, 0);
INSERT INTO `permission` VALUES (10, '恢复', 2, '1-2', '', '', 'permissions', 1, 'get', 'user@recover', '', '', 1, 1, 2, 1, 1587461901, 1587547118, 0);
INSERT INTO `permission` VALUES (11, '角色管理', 1, '1', '/permissions/roles', 'usergroup-add', 'permissions', 1, 'get', 'role@index', 'roles', '', 2, 1, 1, 9, 1587461939, 1587547118, 0);
INSERT INTO `permission` VALUES (12, '列表', 11, '1-11', '', '', 'permissions', 1, 'get', 'role@list', '', '', 1, 1, 2, 1, 1587461984, 1587547118, 0);
INSERT INTO `permission` VALUES (13, '创建', 11, '1-11', '', '', 'permissions', 1, 'get', 'role@create', '', '', 1, 1, 2, 1, 1587462007, 1587547118, 0);
INSERT INTO `permission` VALUES (14, '保存', 11, '1-11', '', '', 'permissions', 1, 'get', 'role@save', '', '', 1, 1, 2, 1, 1587462021, 1587547118, 0);
INSERT INTO `permission` VALUES (15, '查看', 11, '1-11', '', '', 'permissions', 1, 'get', 'role@edit', '', '', 1, 1, 2, 1, 1587462040, 1587547118, 0);
INSERT INTO `permission` VALUES (16, '更新', 11, '1-11', '', '', 'permissions', 1, 'get', 'role@update', '', '', 1, 1, 2, 1, 1587462058, 1587547118, 0);
INSERT INTO `permission` VALUES (17, '删除', 11, '1-11', '', '', 'permissions', 1, 'get', 'role@delete', '', '', 1, 1, 2, 1, 1587462070, 1587547118, 0);
INSERT INTO `permission` VALUES (18, '权限获取', 11, '1-11', '', '', 'permissions', 1, 'get', 'role@getPermissions', '', '', 1, 1, 2, 1, 1587462094, 1587547118, 0);
INSERT INTO `permission` VALUES (19, '菜单管理', 1, '1', '/permissions/rules', 'build', 'permissions', 1, 'get', 'permission@index', 'rules', '', 2, 1, 1, 8, 1587462147, 1587547118, 0);
INSERT INTO `permission` VALUES (20, '列表', 19, '1-19', '', '', 'permissions', 1, 'get', 'permission@index', '', '', 1, 1, 2, 1, 1587462205, 1587547118, 0);
INSERT INTO `permission` VALUES (21, '创建', 19, '1-19', '', '', 'permissions', 1, 'get', 'permission@create', '', '', 1, 1, 2, 1, 1587462232, 1587547118, 0);
INSERT INTO `permission` VALUES (22, '保存', 19, '1-19', '', '', 'permissions', 1, 'get', 'permission@save', '', '', 1, 1, 2, 1, 1587462250, 1587547118, 0);
INSERT INTO `permission` VALUES (23, '查看', 19, '1-19', '', '', 'permissions', 1, 'get', 'permission@edit', '', '', 1, 1, 2, 1, 1587462273, 1587547118, 0);
INSERT INTO `permission` VALUES (24, '更新', 19, '1-19', '', '', 'permissions', 1, 'get', 'permission@update', '', '', 1, 1, 2, 1, 1587462284, 1587547118, 0);
INSERT INTO `permission` VALUES (25, '删除', 19, '1-19', '', '', 'permissions', 1, 'get', 'permission@delete', '', '', 1, 1, 2, 1, 1587462296, 1587547118, 0);
INSERT INTO `permission` VALUES (26, '部门管理', 1, '1', '/permissions/departments', 'desktop', 'permissions', 1, 'get', 'departments', 'departments', '', 2, 1, 1, 7, 1587462488, 1587547118, 0);
INSERT INTO `permission` VALUES (27, '列表', 26, '1-26', '', '', 'permissions', 1, 'get', 'department@index', '', '', 1, 1, 2, 1, 1587462529, 1587547118, 0);
INSERT INTO `permission` VALUES (28, '保存', 26, '1-26', '', '', 'permissions', 1, 'get', 'department@save', '', '', 1, 1, 2, 1, 1587462548, 1587547118, 0);
INSERT INTO `permission` VALUES (29, '更新', 26, '1-26', '', '', 'permissions', 1, 'get', 'department@update', '', '', 1, 1, 2, 1, 1587462579, 1587547118, 0);
INSERT INTO `permission` VALUES (30, '删除', 26, '1-26', '', '', 'permissions', 1, 'get', 'department@delete', '', '', 1, 1, 2, 1, 1587462592, 1587547118, 0);
INSERT INTO `permission` VALUES (31, '岗位管理', 1, '1', '/permissions/jobs', 'skin', 'permissions', 1, 'get', 'jobs', 'jobs', '', 2, 1, 1, 1, 1587462707, 1587547118, 0);
INSERT INTO `permission` VALUES (32, '列表', 31, '1-31', '', '', 'permissions', 1, 'get', 'job@index', '', '', 1, 1, 2, 1, 1587462757, 1587547118, 0);
INSERT INTO `permission` VALUES (33, '保存', 31, '1-31', '', '', 'permissions', 1, 'get', 'job@save', '', '', 1, 1, 2, 1, 1587462774, 1587547118, 0);
INSERT INTO `permission` VALUES (34, '更新', 31, '1-31', '', '', 'permissions', 1, 'get', 'job@update', '', '', 1, 1, 2, 1, 1587462785, 1587547118, 0);
INSERT INTO `permission` VALUES (35, '删除', 31, '1-31', '', '', 'permissions', 1, 'get', 'job@delete', '', '', 1, 1, 2, 1, 1587462794, 1587547118, 0);
INSERT INTO `permission` VALUES (36, '获取全部', 31, '1-31', '', '', 'permissions', 1, 'get', 'job@getAll', '', '', 1, 1, 2, 1, 1587462818, 1587547118, 0);
INSERT INTO `permission` VALUES (37, '系统管理', 0, '', '/system', 'bar-chart', 'system', 1, 'get', 'system', 'pageView', '', 2, 2, 1, 1, 1587462349, 1587622113, 0);
INSERT INTO `permission` VALUES (38, '数据字典', 37, '37', '/system/database', 'hdd', 'system', 1, 'get', 'datadictory', 'database', '', 2, 1, 1, 8, 1587463087, 1587547118, 0);
INSERT INTO `permission` VALUES (39, '查看', 38, '37-38', '', '', 'system', 1, 'get', 'datadictionary@view', '', '', 1, 1, 2, 1, 1587463113, 1587547118, 0);
INSERT INTO `permission` VALUES (40, '列表', 38, '37-38', '', '', 'system', 1, 'get', 'datadictionary@tables', '', '', 1, 1, 2, 10, 1587463173, 1587547118, 0);
INSERT INTO `permission` VALUES (41, '优化', 38, '37-38', '', '', 'system', 1, 'get', 'datadictionary@optimize', '', '', 1, 1, 2, 1, 1587463201, 1587547118, 0);
INSERT INTO `permission` VALUES (42, '备份', 38, '37-38', '', '', 'system', 1, 'get', 'optimize@backup', '', '', 1, 1, 2, 1, 1587463217, 1587547118, 0);
INSERT INTO `permission` VALUES (43, '附件管理', 37, '37', '/attactments', 'folder-open', 'system', 1, 'get', 'attactments', 'attachment', '', 2, 1, 1, 10, 1587463302, 1587547118, 0);
INSERT INTO `permission` VALUES (44, '列表', 43, '37-43', '', '', 'system', 1, 'get', 'attachments@index', '', '', 1, 1, 2, 1, 1587463335, 1587547118, 0);
INSERT INTO `permission` VALUES (45, '删除', 43, '37-43', '', '', 'system', 1, 'get', 'attachments@delete', '', '', 1, 1, 2, 1, 1587463355, 1587547118, 0);
INSERT INTO `permission` VALUES (46, '上传图片', 43, '37-43', '', '', 'system', 1, 'get', 'upload@image', '', '', 1, 1, 2, 1, 1587466919, 1587547118, 0);
INSERT INTO `permission` VALUES (47, '上传文件', 43, '37-43', '', '', 'system', 1, 'get', 'upload@file', '', '', 1, 1, 2, 1, 1587466939, 1587547118, 0);
INSERT INTO `permission` VALUES (48, '配置管理', 37, '37', '/system/config', 'setting', 'system', 1, 'get', 'config', 'config', '', 2, 1, 1, 9, 1587466991, 1587547118, 0);
INSERT INTO `permission` VALUES (49, '获取父级配置', 48, '37-48', '', '', 'system', 1, 'get', 'config@parent', '', '', 1, 1, 2, 1, 1587467036, 1587547118, 0);
INSERT INTO `permission` VALUES (50, '存储', 48, '37-48', '', '', 'system', 1, 'get', 'config@save', '', '', 1, 1, 2, 1, 1587467052, 1587547118, 0);
INSERT INTO `permission` VALUES (51, '获取', 48, '37-48', '', '', 'system', 1, 'get', 'config@read', '', '', 1, 1, 2, 1, 1587467062, 1587547118, 0);
INSERT INTO `permission` VALUES (52, '登陆日志', 37, '37', '/system/log/operate', 'export', 'system', 1, 'get', 'loginLog', 'loginLog', '', 2, 1, 1, 5, 1587467150, 1587547118, 0);
INSERT INTO `permission` VALUES (53, '列表', 52, '37-52', '', '', 'system', 1, 'get', 'loginlog@list', '', '', 1, 1, 2, 1, 1587467206, 1587547118, 0);
INSERT INTO `permission` VALUES (54, '清空', 52, '37-52', '', '', 'system', 1, 'get', 'loginlog@empty', '', '', 1, 1, 2, 1, 1587467221, 1587547118, 0);
INSERT INTO `permission` VALUES (55, '操作日志', 37, '37', '/system/log/login', 'profile', 'system', 1, 'get', 'operateLog', 'operateLog', '', 2, 1, 1, 1, 1587467180, 1587547118, 0);
INSERT INTO `permission` VALUES (56, '列表', 55, '37-55', '', '', 'system', 1, 'get', 'operatelog@list', '', '', 1, 1, 2, 1, 1587467246, 1587547118, 0);
INSERT INTO `permission` VALUES (57, '清空', 55, '37-55', '', '', 'system', 1, 'get', 'operatelog@empty', '', '', 1, 1, 2, 1, 1587467266, 1587547118, 0);
INSERT INTO `permission` VALUES (58, '代码生成', 37, '37', '/generate', 'scissor', 'system', 1, 'get', 'generate', 'generate', '', 2, 1, 1, 1, 1587717452, 1587717452, 0);
INSERT INTO `permission` VALUES (59, '生成', 58, '37-58', '', '', 'system', 1, 'get', 'generate@save', '', '', 1, 1, 2, 1, 1588110923, 1588110923, 0);
INSERT INTO `permission` VALUES (60, '预览', 58, '37-58', '', '', 'system', 1, 'get', 'generate@preview', '', '', 1, 1, 2, 1, 1588110962, 1588110962, 0);
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `status` tinyint(1) DEFAULT '1' COMMENT '角色的启用状态,0不启用,1启用',
  `create_time` int(11) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  `delete_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色表';

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES (1, '超级管理员', 1, NULL, NULL, NULL);
INSERT INTO `role` VALUES (2, '仓库管理员', 1, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for role_permission
-- ----------------------------
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `role_id` int(11) DEFAULT NULL COMMENT '角色表id',
  `permission_id` int(11) DEFAULT NULL COMMENT '权限表id',
  `create_time` int(11) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  `delete_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色和权限关系表';

-- ----------------------------
-- Records of role_permission
-- ----------------------------
BEGIN;
INSERT INTO `role_permission` VALUES (1, 1, 1, NULL, NULL, NULL);
INSERT INTO `role_permission` VALUES (2, 1, 2, NULL, NULL, NULL);
INSERT INTO `role_permission` VALUES (3, 1, 7, NULL, NULL, NULL);
INSERT INTO `role_permission` VALUES (4, 1, 38, NULL, NULL, NULL);
INSERT INTO `role_permission` VALUES (5, 1, 39, NULL, NULL, NULL);
INSERT INTO `role_permission` VALUES (6, 1, 40, NULL, NULL, NULL);
INSERT INTO `role_permission` VALUES (7, 1, 41, NULL, NULL, NULL);
INSERT INTO `role_permission` VALUES (8, 1, 42, NULL, NULL, NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
